package com.htpay.model.eo;

/**
 * 通道枚举类
 * <p>
 * 支付宝H5:101编码
 */
public enum ChannelType {

    CHANNEL_ALIPAY_H5("101", "invokeAliPayH5Channel"),
    CHANNEL_WECHAT_H5("102", "invokeWeChatH5Channel");

    private String code;

    public String getMethod() {
        return method;
    }

    private String method;

    ChannelType(String code, String method) {
        this.code = code;
        this.method = method;
    }

    public static ChannelType getChannelInfo(String code) {
        for (ChannelType ctype : ChannelType.values()) {
            if (ctype.getCode().equals(code)) {
                return ctype;
            }
        }
        return null;
    }

    public String getCode() {
        return this.code;
    }

}
